package com.example.evanproject.mapper;

import com.example.evanproject.domain.Involved;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;

/**
* @author hanxiaoqi
* @description 针对表【involved】的数据库操作Mapper
* @createDate 2024-03-09 21:52:13
* @Entity generator.domain.Involved
*/
@Mapper
public interface InvolvedMapper extends BaseMapper<Involved> {


    @Select("select * from involved where followers_id=#{id}")
    List<Involved> selectfollowedbyid(Integer id);


    //返回关注我的id
    @Select("select * from involved where befollowed_id=#{id}")
    List<Involved> selectfansbyid(Integer id);


    @Insert("insert into involved(followers_id,befollowed_id) values(#{myId},#{userId})")
    Integer addfollow(Integer myId, Integer userId);


    @Delete("delete from involved where followers_id=#{myId} and befollowed_id=#{userId}")
    Integer deletefollow(Integer myId, Integer userId);

    List<String> relationship(@Param("followersId") Integer followersId,@Param("befollowedId") Integer befollowedId);

    Map relationListNum(Integer peopleId);
}




